/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 说明：
 * Entity Name 优惠券
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TCashCard")
public class TCashCard implements Serializable{

	private static final long serialVersionUID = 1L;

	private String CardID;//优惠券编号CHAR(15) PK
	
	private double Money;//金额DECIMAL(20,3)
	
	private Date StartTime;//开始时间DATETIME
	
	private Date EndTime;//结束时间
	
	private Date HappenTime;//创建时间
	
	private String PublishType;//发放类型CHAR(18) 1为任何客户都可以主动领取 2为只有店家可以主动送出，客户不能主动领取
	
	private String Creator;//创建人CHAR(15)如果可以领取的话，客户领取时创建人即”我的优惠券“表中的赠送人
	
	private String UseType;//使用类型CHAR(18)1为一次性优惠券
	
	private String CatalogID;//适用商品类别编号CHAR(15)
	
	private int NeedPoint;//领取消耗积分INTEGER
	
	private Set<TMyCashCard> TMyCashCards=new HashSet<TMyCashCard>(0);//我的优惠劵

	
	@Id
	@Column(name = "CardID", length=15)
	public String getCardID() {
		return CardID;
	}

	public void setCardID(String cardID) {
		CardID = cardID;
	}

	@Column(name = "Money", precision = 20, scale = 3)
	public double getMoney() {
		return Money;
	}

	public void setMoney(double money) {
		Money = money;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "StartTime", nullable = false, length = 19)
	public Date getStartTime() {
		return StartTime;
	}

	public void setStartTime(Date startTime) {
		StartTime = startTime;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EndTime", nullable = false, length = 19)
	public Date getEndTime() {
		return EndTime;
	}

	public void setEndTime(Date endTime) {
		EndTime = endTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "HappenTime", nullable = false, length = 19)
	public Date getHappenTime() {
		return HappenTime;
	}

	public void setHappenTime(Date happenTime) {
		HappenTime = happenTime;
	}

	@Column(name = "PublishType", length=18)
	public String getPublishType() {
		return PublishType;
	}

	public void setPublishType(String publishType) {
		PublishType = publishType;
	}

	@Column(name = "Creator", length=15)
	public String getCreator() {
		return Creator;
	}

	public void setCreator(String creator) {
		Creator = creator;
	}

	@Column(name = "UseType", length=18)
	public String getUseType() {
		return UseType;
	}

	public void setUseType(String useType) {
		UseType = useType;
	}

	@Column(name = "CatalogID", length=15)
	public String getCatalogID() {
		return CatalogID;
	}

	public void setCatalogID(String catalogID) {
		CatalogID = catalogID;
	}

	@Column(name = "NeedPoint")
	public int getNeedPoint() {
		return NeedPoint;
	}

	public void setNeedPoint(int needPoint) {
		NeedPoint = needPoint;
	}
	
	@OneToMany(mappedBy="TCashCard")
	@JoinColumn(name="CardID")
	public Set<TMyCashCard> getTMyCashCards() {
		return TMyCashCards;
	}

	public void setTMyCashCards(Set<TMyCashCard> tMyCashCards) {
		TMyCashCards = tMyCashCards;
	}
}
